<?php

namespace app\admin\model;

use think\Model;

class Order extends Model
{
    // 查询所有的订单数据
    public static function getOrder()
    {
        return self::alias('o')
            ->field('o.*,g.*,u.username')
            ->join("think_order_goods g",'o.id = g.order_id')
            ->join('think_user u','o.user_id = u.id')
            ->where('o.pay_status',1)
            ->order('g.id','desc')
            ->select();
    }
}
